package com.example.entity;

import server.HttpServlet;

import java.util.Map;

/**
 * 用来存储域名、端口、项目名称、根目录、servlet 映射信息
 *
 * @author kangshuai
 */
public class Host {
    /**
     * 域名
     */
    private String hostName;

    /**
     * 端口号8080
     */
    private int port = 8080;

    /**
     * 部署项目文件夹的根路径
     */
    private String appBase;

    /**
     * 项目名称,该项目下的所有的servlet映射关系集合
     */
    private Map<String, Map<String, HttpServlet>> map;


    public Host() {
    }

    public Host(String hostName, int port, String appBase, Map<String, Map<String, HttpServlet>> map) {
        this.hostName = hostName;
        this.port = port;
        this.appBase = appBase;
        this.map = map;
    }

    public String getHostName() {
        return hostName;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getAppBase() {
        return appBase;
    }

    public void setAppBase(String appBase) {
        this.appBase = appBase;
    }

    public Map<String, Map<String, HttpServlet>> getMap() {
        return map;
    }

    public void setMap(Map<String, Map<String, HttpServlet>> map) {
        this.map = map;
    }

    @Override
    public String toString() {
        return "Host{" +
                "hostName='" + hostName + '\'' +
                ", port='" + port + '\'' +
                ", appBase='" + appBase + '\'' +
                ", map=" + map +
                '}';
    }
}
